﻿// Copyright (c)  MOKEYISH. All rights reserved.
// Licensed under the MIT License, See License.txt in the project root for license information.

namespace NSQL.Expressions
{
    public interface IConstantBooleanExpression : ILogicalExpression, IConstantExpression<bool>
    {
    }
    public class BooleanExpression : ConstantExpression, IConstantBooleanExpression
    {
        public bool Value { get; set; }

        public override object ValueOf() => Value;
        private BooleanExpression(bool value) => Value = value;

        public static readonly BooleanExpression True = new BooleanExpression(true);
        public static readonly BooleanExpression False = new BooleanExpression(false);

        public static explicit operator BooleanExpression(bool val) => val ? True : False;
    }
}